﻿@using Orchard.Modules.Extensions;
@using Orchard.Mvc.Html;
@using Orchard.Modules.ViewModels;
@using Orchard.Environment.Extensions.Models;

@{ string moduleClasses = Model.ContentPart.IsRecentlyInstalled ? "recentlyInstalledModule" : string.Empty; }

<div class="summary">
 @if (Model.ContentPart.Notifications != null && Model.ContentPart.Notifications.Count > 0) {
            <div class="notifications">
            @foreach (string notification in Model.ContentPart.Notifications) {
                <h5>@Html.Raw(notification)</h5>
            }
            </div>
        }
    <div class="properties">
        <h2@{ if(!string.IsNullOrEmpty(moduleClasses)) {<text> class="@moduleClasses"</text>}}>@Model.ContentPart.Descriptor.Name<span> - @T("Version: {0}", !string.IsNullOrEmpty(Model.ContentPart.Descriptor.Version) ? Model.ContentPart.Descriptor.Version : T("1.0").ToString())</span></h2>

         @if (!string.IsNullOrEmpty(Model.ContentPart.Descriptor.Description)) {
        <p>@Model.ContentPart.Descriptor.Description</p>
        }

        <ul class="pageStatus" style="color:#666; margin:.6em 0 0 0;">
            @{ IEnumerable<FeatureDescriptor> features = Model.ContentPart.Descriptor.Features; }
            <li>@T("Features: {0}", MvcHtmlString.Create(string.Join(", ", features.Select(f => Html.Link(string.IsNullOrEmpty(f.Name) ? f.Id : f.Name, string.Format("{0}#{1}", Url.Action("features", new { area = "Orchard.Modules" }), f.Id.AsFeatureId(n => T(n)))).ToString()).OrderBy(s => s).ToArray())))</li>
            <li>&nbsp;&#124;&nbsp;@T("Author: {0}", !string.IsNullOrEmpty(Model.ContentPart.Descriptor.Author) ? Model.ContentPart.Descriptor.Author : T("Unknown").ToString())</li>
            <li>&nbsp;&#124;&nbsp;@T("Website: ")
                @if (!string.IsNullOrEmpty(Model.ContentPart.Descriptor.WebSite)) { <a href="@Model.ContentPart.Descriptor.WebSite">@Model.ContentPart.Descriptor.WebSite</a> }
                else { @T("Unknown").ToString() }
            </li>
        </ul>
    </div>
</div>